﻿<div class="blade-content __large-wide">
    <div class="blade-inner">
        <div class="inner-block">
            <form class="form" name="edit">
                <div class="note" ng-init="setForm(edit)">
                    <p>{{ 'platform.blades.notifications-edit-template.labels.note' | translate }}:</p>
                    <br />
                    <table style="border-collapse: collapse;">
                        <tbody>
                            <tr>
                                <td style="border:1px solid #dddddd; padding: 6px; text-align:center;">{{ 'platform.blades.notifications-edit-template.labels.parameter-name' | translate }}</td>
                                <td style="border:1px solid #dddddd; padding: 6px; text-align:center;">{{ 'platform.blades.notifications-edit-template.labels.parameter-description' | translate }}</td>
                                <td style="border:1px solid #dddddd; padding: 6px; text-align:center;">{{ 'platform.blades.notifications-edit-template.labels.paremeter-code' | translate }}</td>
                            </tr>
                            <tr ng-repeat="data in blade.parametersForTemplate">
                                <td style="border:1px solid #dddddd; padding: 6px; text-align:center;">{{ data.parameterName }}</td>
                                <td style="border:1px solid #dddddd; padding: 6px; text-align:center;">{{ data.parameterDescription }}</td>
                                <td style="border:1px solid #dddddd; padding: 6px; text-align:center;">{{ data.parameterCodeInView }}</td>
                            </tr>
                        </tbody>
                    </table>
                </div>

                <div class="form columns clearfix">
                    <div class="column">
                        <fieldset>
                            <legend>{{ 'platform.blades.notifications-edit-template.labels.language' | translate }}</legend>
                            <div class="form-group" style="margin-top:0">
                                <div class="form-input">
                                    <ui-select ng-model="blade.currentEntity.language">
                                        <ui-select-match placeholder="{{ 'platform.blades.notifications-edit-template.placeholders.language' | translate }}"><span class="flag flag-{{blade.getFlag($select.selected)}}"></span> {{$select.selected}}</ui-select-match>
                                        <ui-select-choices repeat="x in blade.languages">
                                            <span ng-bind-html="x"></span>
                                        </ui-select-choices>
                                    </ui-select>
                                </div>
                            </div>
                        </fieldset>
                    </div>
                    <div class="column"></div>
                </div>

                <fieldset style="margin-top:20px;" ng-if="blade.isNew">
                    <legend>{{ 'platform.blades.notifications-edit-template.labels.sender' | translate }}</legend>
                    <div class="form-group" style="margin-top:0">
                        <div class="form-input">
                            <ui-codemirror ng-model="blade.currentEntity.sender" ui-codemirror-opts="editorOptions"></ui-codemirror>
                        </div>
                        <div class="table-descr">
                            {{ 'platform.blades.notifications-edit-template.labels.blank-note' | translate }}
                        </div>
                    </div>
                </fieldset>
                <fieldset ng-if="!blade.isNew">
                    <legend>{{ 'platform.blades.notifications-edit-template.labels.sender' | translate }}</legend>
                    <div class="form-group" style="margin-top:0">
                        <div class="form-input">
                            <ui-codemirror ng-model="blade.currentEntity.sender" ui-codemirror-opts="editorOptions"></ui-codemirror>
                        </div>
                        <div class="table-descr">
                            {{ 'platform.blades.notifications-edit-template.labels.blank-note' | translate }}
                        </div>
                    </div>
                </fieldset>

                <fieldset style="margin-top:20px;">
                    <legend>{{ 'platform.blades.notifications-edit-template.labels.recipient' | translate }}</legend>
                    <div class="form-group" style="margin-top:0">
                        <div class="form-input">
                            <ui-codemirror ng-model="blade.currentEntity.recipient" ui-codemirror-opts="editorOptions"></ui-codemirror>
                        </div>
                        <div class="table-descr">
                            {{ 'platform.blades.notifications-edit-template.labels.blank-note' | translate }}
                        </div>
                    </div>
                </fieldset>

                <fieldset style="margin-top:20px;">
                    <legend>{{ 'platform.blades.notifications-edit-template.labels.subject' | translate }}</legend>
                    <div class="form-group" style="margin-top:0">
                        <div class="form-input">
                            <ui-codemirror ng-model="blade.currentEntity.subject" ui-codemirror-opts="editorOptions"></ui-codemirror>
                        </div>
                    </div>
                </fieldset>

                <fieldset style="margin-top:20px;">
                    <legend>{{ 'platform.blades.notifications-edit-template.labels.body' | translate }}</legend>
                    <div class="form-group" style="margin-top:0">
                        <div class="form-input">
                            <ui-codemirror required ng-model="blade.currentEntity.body" ui-codemirror-opts="editorOptions"></ui-codemirror>
                        </div>
                    </div>
                </fieldset>
            </form>
        </div>
    </div>
</div>